<template>
  <!-- 结算信息table组件 -->
  <div>
    <!-- <transition name="el-zoom-in-top">
      <div class="download" v-show="checkboxSelect > 0">
        <i class="el-icon-info"></i>
        共{{ total }}项，已选择<b>{{ checkboxSelect }}</b
        >项
        <span @click="excelDownload">下载</span>
        <em @click="cleanSelection">清空</em>
      </div>
    </transition> -->
    <el-table
      :data="tableData"
      @selectionChange="downloadWhether"
      stripe
      style="width: 100%"
      @selection-change="handleSelectionChange"
      ref="multipleTable"
      :row-key="getRowKeys"
      @sort-change="sortChange"
    >
      <!-- <template v-if="platformId != undefined || bussinessId != undefined">
        <el-table-column width="45"> </el-table-column>
      </template>
      <template v-else>
        <el-table-column type="selection" :reserve-selection="true" width="45"> </el-table-column>
      </template> -->
      <el-table-column prop="number" align="center" sortable="custom" label="序号">
      </el-table-column>
      <el-table-column prop="settlementNo" sortable="custom" label="结算单编号" width="145">
      </el-table-column>
      <el-table-column prop="businessName" sortable="custom" label="企业名称" width="200">
      </el-table-column>
      <el-table-column prop="projectName" sortable="custom" label="项目名称" width="150">
      </el-table-column>
      <el-table-column prop="personNum" sortable="custom" label="发放人数" width="110">
      </el-table-column>
      <el-table-column prop="amount" sortable="custom" label="发放总金额" width="110">
        <template #default="item">
          {{ formatNumber(item.row.amount) }}
        </template>
      </el-table-column>
      <el-table-column prop="tax" sortable="custom" label="服务费率" width="110">
        <template #default="item">
          {{ formatNumber(item.row.feeRate) }}%
        </template>
      </el-table-column>
      <el-table-column prop="fee" sortable="custom" label="服务费" width="100">
        <template #default="item">
          {{ formatNumber(item.row.fee) }}
        </template>
      </el-table-column>
      <el-table-column prop="tax" sortable="custom" label="浪潮服务费率" width="120">
        <template #default="item">
          {{ formatNumber(item.row.feeRateLc) }}‰
        </template>
      </el-table-column>
      <el-table-column prop="fee" sortable="custom" label="浪潮服务费" width="110">
        <template #default="item">
          {{ formatNumber(item.row.feeLc) }}
        </template>
      </el-table-column>
      <el-table-column prop="settlementAmount" sortable="custom" label="实付总金额" width="110">
        <template #default="item">
          {{ formatNumber(item.row.settlementAmount) }}
        </template>
      </el-table-column>
      <el-table-column
        prop="settlementStatus"
        align="center"
        label="发放状态"
        width="80"
      >
        <template #default="item">
          {{ settlementStatus[item.row.paymentStatuts] }}
        </template>
      </el-table-column>
      <el-table-column prop="authPayCode" label="审核状态"  width="80">
        <template #default="item">
            {{ authPayCode[item.row.authPayCode] }}
          </template>
      </el-table-column>
      <el-table-column v-if="paymentStatuts1 == 2" prop="isApplyInvoice" label="是否开票">
        <template #default="item">
          {{ item.row.isApplyInvoice == 1 ? '是' : '否' }}
        </template>
      </el-table-column>
      <el-table-column prop="createTime" sortable="custom" label="建单时间" width="148">
        <template #default="item">
          <span v-if="item.row.createTime == null">--</span>
          <span v-else>{{ format("yyyy-MM-dd hh:mm:ss", new Date(item.row.createTime)) }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="platformPayTime" sortable="custom" label="发放时间" width="148">
        <template #default="item">
          <span v-if="item.row.platformPayTime == null">--</span>
          <span v-else>{{ format("yyyy-MM-dd hh:mm:ss", new Date(item.row.platformPayTime)) }}</span>
        </template>
      </el-table-column>
      <el-table-column
        v-if="paymentStatuts1 == 2"
        prop="caozuo"
        align="center"
        label="打款凭证"
        width="100"
        class-name="editor"
      >
        <template #default="item">
          <template v-if="item.row.paymentReceiptUrl == null || item.row.paymentReceiptUrl == ''"
            >-</template
          >
          <el-button
            v-else
            type="text"
            @click="openUrl(item.row.paymentReceiptUrl)"
            >查看</el-button
          >
        </template>
      </el-table-column>
      <el-table-column
        v-if="paymentStatuts1 == 2"
        prop="caozuo"
        align="center"
        label="打款明细"
        width="100"
        class-name="editor"
      >
        <template #default="item">
          <template v-if="item.row.paymentDetailUrl == null || item.row.paymentDetailUrl == ''"
            >-</template
          >
          <el-button
            v-else
            type="text"
            @click="openUrl(item.row.paymentDetailUrl)"
            >查看</el-button
          >
        </template>
      </el-table-column>
      <el-table-column
        prop="caozuo"
        width="220"
        label="操作"
        class-name="editor"
      >
        <template #default="item">
          <router-link
            :to="{
              path: 'settlementDels',
              query: { id: item.row.id,settleNo: item.row.settlementNo,businessName: item.row.businessName },
            }"
          >
            <el-button type="text">详情</el-button>
          </router-link>
          <el-button type="text" v-if="item.row.authPayCode == 0" @click="examines(item.row)">审核</el-button>
          <el-button type="text" style="margin-left: -5px;" @click="excelDownload1(item.row)">下载确认单</el-button>
          <el-button type="text" v-if="item.row.accountBillUrl" style="margin-left: -5px;" @click="excelDownload2(item.row)">下载对账单</el-button>
          <!-- <el-button type="text" v-if="item.row.paymentStatuts == 1" @click="selectSettleListByNo1(item.row)">发放</el-button> -->
          <!-- <template v-if="item.row.paymentStatuts == 2">
            <el-button type="text" @click="settlementService(item.row.settlementNo)"
              >打款回执</el-button
            >
            <el-button type="text" @click="settlementServices(item.row)"
              >打款情况</el-button
            >
          </template> -->
        </template>
      </el-table-column>
    </el-table>

    <el-pagination
      v-if="tableData.length > 0"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="arrPage"
      :page-size="selectPage"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>

     <!-- 打款情况 -->
		<el-dialog title="佣金发放" custom-class="examine-style" v-model="selectSettleListByNo" width="40%">
			<div class="cardTits add-task">
        <el-form
            :model="taskForm"
            :rules="rules"
            ref="taskForm"
            label-width="150px"
            class="demo-ruleForm"
          >
          <el-form-item label="打款方式" prop="companyType">
              <el-select v-model="companyType" placeholder="请选择">
                <el-option label="线上" value="online"></el-option>
                <el-option label="线下" value="underline"></el-option>
              </el-select>
          </el-form-item>
          <div v-if="companyType == 'underline'">
            <el-form-item label="汇款回执单" required>
              <el-upload
                class="upload-demo"
                action=""
                accept="image/png,image/jpeg,application/pdf"
                :multiple="false"
                :limit="1"
                :file-list="fileList"
                :before-remove="file => beforeRemove('huizhiUrl')"
                :http-request="file => handleChange(file, 'huizhiUrl')"
              >
                <el-button size="small" plain>点击上传汇款回执单</el-button>
              </el-upload>
            </el-form-item>
            <el-form-item label="汇款明细">
              <el-upload
                class="upload-demo"
                action=""
                accept="image/png,image/jpeg,application/pdf,.xls,.xlsx"
                :multiple="false"
                :limit="1"
                :before-remove="file => beforeRemove('mingxiUrl')"
                :file-list="fileList"
                :http-request="file => handleChange(file, 'mingxiUrl')">
                <el-button size="small" plain>点击上传汇款明细</el-button>
              </el-upload>
            </el-form-item>
          </div>
        </el-form>
			</div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="selectSettleListByNo = false">取 消</el-button>
          <el-button type="primary" @click="addTaskMethods1">确 定</el-button>
        </span>
      </template>
		</el-dialog>

    <!-- 审核 -->
    <el-dialog
      title="审核"
      custom-class="task-dialog"
      v-model="taskDelShow"
      width="40%"
    >
      <div class="examines">
        <el-form
            ref="taskForm"
            class="demo-ruleForm"
          >
           <!-- v-if="payMode == 1" -->
          <el-form-item style="margin: -10px 13px 16px 70px;" label="税源地：" prop="bankExtendId">
            <el-select v-model="taskForm.bankExtendId" placeholder="请选择税源地" @change="setDateRanges()">
                <el-option
                  v-for="item in tableDatas2"
                  :key="item.id"
                  :label="item.authBusinessName"
                  :value="item.id"
                >
                </el-option>
              </el-select>
          </el-form-item>
          <el-form-item>
            <b>审核意见：</b>
            <el-input style="height: 500" type="textarea" v-model="grtdsp"></el-input>
          </el-form-item>  
        </el-form> 
      </div> 
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="taskDelShow = false">取 消</el-button>
          <el-button type="danger" @click="taskDelShow1(1)">驳 回</el-button>
          <el-button type="primary" @click="taskDelShow1(2)">通 过</el-button>
        </span>
      </template>
    </el-dialog>

    <el-dialog title="下载确认单" custom-class="examine-style" v-model="excelDownloadShows" width="40%">
			<div class="cardTits">
				<div class="serveTime">选择服务时间：</div>
				<el-date-picker
                    v-model="value1"
                    type="daterange"
                    start-placeholder="开始时间"
                    end-placeholder="结束时间"
                    range-separator="~">
                 </el-date-picker>
			</div>
			<template #footer>
				<span class="dialog-footer">
				<el-button @click="addTaskMethods2">取 消</el-button>
				<el-button type="primary" @click="excelDownloadShow1"
					>确 定</el-button
				>
				</span>
			</template>
		</el-dialog>
  </div>
</template>

<script>
import axios from "axios";
import { ElLoading } from 'element-plus'
export default {
  props: ["bussinessId", "platformId", "search","personalType"],
  data() {
    return {
      cycleId: "",
      fileList: [],
      taskDelShow: false,
      reqnbrs: '',
      grtdsp: '',
      settlementNos: '',
      dialogImageUrl: [],
      fileLists: [],
      fileUrl: {
        huizhiUrl: '',
        mingxiUrl: ''
      },
      taskForm: {
        bankExtendId: "",
        businessId: "", 
      },
      tableDatas2: [],
      dialogImageUrls: [],
      getRowKeys(row) {
        // 获取row的key值
        return row.id;
      },
      // 审核状态
      authPayCode: {
        0: "待审核",
        1: "审核通过",
        2: "驳回",
        3: "未打款",
      },
      // 发放状态 paymentStatuts = settlementStatus
      paymentStatuts: {
        1: "未打款",
        2: "已打款",
        3: "已作废",
        4: "部分打款",
        5: "平台审核中",
        6: "驳回",
      },
      // 发放状态
      settlementStatus: {
        1: "未打款",
        2: "已打款",
        3: "已作废",
        4: "部分打款",
        5: "平台审核中",
        6: "驳回",
      },
      value1: '',
      payMode: '',
      startTime: '',
      authNumbId: '',
      endTime: '',
      online: '',
      underline: '',
      companyType: '',
      serveTime: '',
      paymentStatuts1: '',
      paymentStatuts2: '',
      orderByZH: false,
      orderByAsc: false,
      authPayCodes: '',
      orderByColume: 'createTime',
      tableData: [],
      businessNames: '',
      selectSettleListByNo: false,
      selectSettleListByNos: [],
      currentPage: 1,
      excelDownloadShow: false,
      excelDownloadShows: false,
      settlementNo: '',
      total: 0, // 总条数
      arrPage: [10, 20], // 每页条数
      selectPage: 10, // 每页选中条数
      checkboxSelect: 0,
      totals: 0,
      serviceShow: false, // 是否显示打款回执
      serviceArr: [],
      servicePayment: [],
      dakuanCurrentPage: 1,
      dakuanTotal: 0, // 总条数
      dakuanArrPage: [10, 20], // 每页条数
      dakuanSelectPage: 10, // 每页选中条数
      dwonloadList: [], // 选中的数据
      dakuanhuizhiShui: [],
      authId: '',
    };
  },
  created() {
    this.getTableAll();
  },
  methods: {
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handleChange(param,name) {
      console.log(param)
      // 上传
			const form = new FormData()
      // 文件对象
      form.append('file', param.file)
      let loadingAlert = ElLoading.service({
          lock: true,
          text: '上传中...',
          customClass: 'custom-loading',
          spinner: 'el-icon-loading',
          background: 'rgba(0, 0, 0, 0.1)'
      })
			this.$http({
        method: "POST",
        url: "/api/quick/oss/uploadBySingle",
				headers: {
          "content-type": "multipart/form-data",
          // "Authorization": localStorage.getItem("bussines_token")
        },
        data: form
     }).then(data => {
        if(data.code == 0) {
          this.fileUrl[name] = data.result
        }else {
          this.$message.error("上传失败")
        }
        loadingAlert.close()
      })
    },
    handleRemoves(file, fileLists) {
      console.log(file, fileLists);
    },
    handleChanges(file,fileLists) {
      this.dialogImageUrls = [];
      console.log(file, fileLists);
      for(var i = 0;i < fileLists.length; i++){
        this.dialogImageUrls.push(fileLists[i].url)
      }
    },
    selectSettleListByNo1(row){
      this.companyType == ''
      this.selectSettleListByNoId = row.id
      this.selectSettleListByNo = true
    },
    
    getTableAll() {
      if (this.bussinessId) {
        // 企业结算
        this.getBussinessTableData();
      } else if (this.platformId) {
        this.getPlatformData();
      } else {
        this.getTableData();
      }
    },
    getTableData() {
      if(this.personalType == 0){
        this.paymentStatuts1 = ''
      }else {
        this.paymentStatuts1 = this.personalType
      }
      // 获取列表信息
      this.$http({
        url: "/api/quick/numb/getNumbListPage",
        // url: "/api/quick/numb/getNumbDetailPage",
        method: "post",
        headers: {
          "Content-Type": "application/json",
        },
        data: {
          paymentStatuts: this.paymentStatuts1,
          projectName: this.search, // 结算单号
          // businessId: "", // 个体工商户id
          // platformId: "", // 灵活用工平台id
          pageNum: this.currentPage,
          pageSize: this.selectPage,
          orderByAsc: this.orderByAsc, // 是否正序
          orderByColume: this.orderByColume, // 排序字段
          orderByZH: this.orderByZH, // 是否汉字
        },
      }).then((data) => {
        if (data.code === 0) {
          this.tableData = data.result.list;
          this.total = data.result.total;
        }
      });
    },
    getBussinessTableData() {
      // 获取企业结算列表信息
      this.$http({
        url: "/api/business/selectSettlementInfoByBusinessId",
        method: "post",
        headers: {
          "Content-Type": "application/json",
        },
        data: {
          businessId: this.bussinessId, // 企业id
          mixedStr: "", // 灵活用工平台id
          pageNum: this.currentPage,
          pageSize: this.selectPage,
          orderByAsc: this.orderByAsc, // 是否正序
          orderByColume: this.orderByColume, // 排序字段
          orderByZH: this.orderByZH, // 是否汉字
        },
      }).then((data) => {
        if (data.code === 0) {
          this.tableData = data.result.list;
          this.total = data.result.total;
        }
      });
    },
    getPlatformData() {
      // 获取灵工平台结算列表信息
      this.$http({
        url: "/api/platform/selectSettlementInfoByPlatformId",
        method: "post",
        headers: {
          "Content-Type": "application/json",
        },
        data: {
          platformId: this.platformId, // 企业id
          pageNum: this.currentPage,
          pageSize: this.selectPage,
          orderByAsc: this.orderByAsc, // 是否正序
          orderByColume: this.orderByColume, // 排序字段
          orderByZH: this.orderByZH, // 是否汉字
        },
      }).then((data) => {
        if (data.code === 0) {
          this.tableData = data.result.list;
          this.total = data.result.total;
        }
      });
    },
    sortChange(d) {
				// 监听排序
      if(d.prop == null) {
        // 默认排序方式
        this.orderByZH = false
        this.orderByAsc = false
        this.orderByColume = 'createTime'
      }else {
        let orderByZH = false
        if(d.prop == "businessName" || d.prop == "industyMsg" || d.prop == "platformName" || d.prop == "name") {
          orderByZH = true
        }
        this.currentPage = 1
        this.selectPage = 10
        let orderByAsc = d.order == "descending" ? false : true
        this.orderByZH = orderByZH
        this.orderByAsc = orderByAsc
        this.orderByColume = d.prop
      }
      if (this.bussinessId) {
        // 企业结算
        this.getBussinessTableData();
      } else if (this.platformId) {
        this.getPlatformData();
      } else {
        this.getTableData();
      }
    },
    sortChange1(d) {
				// 监听排序
      if(d.prop == null) {
        // 默认排序方式
        this.orderByZH = false
        this.orderByAsc = false
        this.orderByColume = 'createTime'
      }else {
        let orderByZH = false
        if(d.prop == "businessName" || d.prop == "industyMsg" || d.prop == "platformName" || d.prop == "name") {
          orderByZH = true
        }
        this.currentPage = 1
        this.selectPage = 10
        let orderByAsc = d.order == "descending" ? false : true
        this.orderByZH = orderByZH
        this.orderByAsc = orderByAsc
        this.orderByColume = d.prop
      }
      this.settlementService(this.settlementNo);
    },
    dakuanSizeChange(val) {
      // 打款回执切换每页条数调用
      this.dakuanSelectPage = val;
      this.settlementService(this.settlementNo)
    },
    dakuanCurrentChange(val) {
      // 打款回执切换当前页数调用
      this.dakuanCurrentPage = val;
      this.settlementService(this.settlementNo)
    },
    handleSelectionChange() {},
    handleSizeChange(val) {
      // 切换每页条数调用
      this.selectPage = val;
      this.getTableAll();
    },
    handleCurrentChange(val) {
      // 切换当前页数调用
      this.currentPage = val;
      this.getTableAll();
    },
    excelDownload() {
      // 下载
      let checkSelect = new FormData();
      for (let i = 0; i < this.dwonloadList.length; i++) {
        checkSelect.append("list", this.dwonloadList[i].id);
      }
      axios({
        method: "POST",
        url: "/api/settlement/settleListExcel",
        data: checkSelect,
        responseType: "blob",
        headers: {
          Authorization: localStorage.getItem("hegui_token"),
        },
      })
        .then((res) => {
          const blob = new Blob([res.data]);
          const downloadElement = document.createElement("a");
          const href = window.URL.createObjectURL(blob);
          //后台再header中传文件名
          downloadElement.href = href;
          downloadElement.download =
            "结算信息" + this.format("yyyyMMddhhmmss", new Date()) + ".xlsx";
          document.body.appendChild(downloadElement);
          downloadElement.click();
          document.body.removeChild(downloadElement); // 下载完成移除元素
          window.URL.revokeObjectURL(href); // 释放掉blob对象
        })
        .catch((err) => {
          console.log(err);
        });
    },
    downloadWhether(d) {
      this.checkboxSelect = d.length;
      this.dwonloadList = d;
    },
    cleanSelection() {
      // 清空选择
      this.$refs.multipleTable.clearSelection();
    },
    async settlementService(id) {
      // 获取个体服务费
      this.settlementNo = id;
      await this.$http({
        url: "/api/settlement/selectSettleSevicerListByNo",
        method: "post",
        headers: {
          "Content-Type": "application/json",
        },
        data: {
          pageNum: this.dakuanCurrentPage,
          pageSize: this.dakuanSelectPage,
          businessId: "",
          settlementNo: id,
          platformId: "",
          orderByAsc: this.orderByAsc, // 是否正序
          orderByColume: this.orderByColume, // 排序字段
          orderByZH: this.orderByZH, // 是否汉字
        },
      }).then((data) => {
        if (data.code === 0) {
          this.totals = data.result.total
          this.serviceArr = data.result.list
          this.dakuanTotal = data.result.total
        }
      });

      // 税费/服务费
      await this.$http({
        url: "/api/settlement/selectSettleTaxByPlatformId",
        method: "post",
        headers: {
          "Content-Type": "application/json",
        },
        data: {
          pageNum: 1,
          pageSize: 10,
          businessId: "",
          settlementNo: id,
          platformId: "",
          orderByAsc: this.orderByAsc, // 是否正序
          orderByColume: this.orderByColume, // 排序字段
          orderByZH: this.orderByZH, // 是否汉字
        },
      }).then((data) => {
        if (data.code === 0) {
          this.dakuanhuizhiShui = [data.result]
        }
      });
      // 打款回执
      this.serviceShow = true;
    },
    settlementServices(item){
      // 打款情况
      this.selectSettleListByNo = true;
      this.selectSettleListByNos = [item];
    },
    openUrl(url) {
      // console.log(url.slice(5))
      // 打开新窗口查看协议
      if(url === '' || url === null || url === undefined) return
      let str = url.substring(0, url.indexOf('?'))
      let suffix = str.substring(str.lastIndexOf('.'), url.length)
      if(suffix === '.PDF' || suffix === '.pdf') {
        window.open(url)
      }else {
        let newwin = window.open();
        newwin.document.write("<img src=" + url + " />");
      }
    },
    excelDownload1(row) {
      this.value1 = ''
      this.endTime = ''
      this.startTime = ''
      this.cycleId = row.id 
      this.businessNames = row.businessName
      this.excelDownloadShows = true;
    },
    excelDownload2(row){
      window.open(row.accountBillUrl)
    },
    addTaskMethods2() {
      this.excelDownloadShows = false
    },
    excelDownloadShow1() {
      // 获取列表信息
      if(this.value1){
        // this.format("yyyyMMddhh", new Date(this.value1[1]))
        this.endTime = this.format("yyyy年MM月dd日", new Date(this.value1[1]))
        this.startTime = this.format("yyyy年MM月dd日", new Date(this.value1[0]))
      }else {
        this.endTime = ''
        this.startTime = ''
      }
      this.serveTime = this.startTime + '-' + this.endTime
      let info = JSON.parse(localStorage.getItem("linggong_info"))
				// let checkSelect = new FormData();
				axios({
					method: "POST",
					url: "/api/quick/numb/downConfirmBill",
					data: {
						id: this.cycleId,
						cycle: this.serveTime
					},
					responseType: "blob",
					headers: {
						"businessType": 4,
						"websiteName": window.location.hostname,
						"Authorization": localStorage.getItem("linggong_token"),
						// "businessId": this.businessIds,
						// "businessNo": info.businessNo,
						"platformId": info.platformId,
						"platformNo": info.platformNo,
					},
				})
				.then((res) => {
				const blob = new Blob([res.data]);
				const downloadElement = document.createElement("a");
				const href = window.URL.createObjectURL(blob);
				//后台再header中传文件名
				downloadElement.href = href;
				downloadElement.download = "确认单-" + this.businessNames + '-' + this.format("yyyyMMddhhmmss", new Date()) + ".xlsx";
				document.body.appendChild(downloadElement);
				downloadElement.click();
				document.body.removeChild(downloadElement); // 下载完成移除元素
				window.URL.revokeObjectURL(href); // 释放掉blob对象
				this.excelDownloadShow = false
				})
				.catch((err) => {
				console.log(err);
				});
    },
    setDateRanges(){
      for(var i = 0; i < this.tableDatas2.length; i++){
        if(this.tableDatas2[i].id == this.taskForm.bankExtendId){
          // this.authBankNos = this.tableDatas2[i].authBankNo
          this.authId = this.tableDatas2[i].id
          console.log(this.authId)
        }
      }
    }, 
    examines(row) {
      // 审核
      this.taskForm.bankExtendId = ''
      this.grtdsp = ''
      this.taskDelShow = true
      this.payMode = row.payMode
      this.authNumbId = row.id
      this.settlementNos = row.settlementNo
      // 查询企业绑定的税源地
      this.$http({
        url: "/api/quick/tax/selectByBusinessId",
        method: "post",
        headers: {
          "Content-Type": "application/json",
        },
        data: {
          businessId: row.businessId,
          pageNum: this.currentPage,
          pageSize: this.selectPage,
          orderByAsc: this.orderByAsc, // 是否正序
          orderByColume: this.orderByColume, // 排序字段
          orderByZH: this.orderByZH, // 是否汉字
        },
      }).then((data) => {
        if (data.code == 0) {
          this.tableDatas2 = data.result
        }
      });
    },
    taskDelShow1(nums){
      if(nums == 1){
        this.paymentStatuts2 = 6
        this.authPayCodes = 2
        this.grtflg = 'N'
      }else {
        this.grtflg = 'Y'
        this.authPayCodes = 1
        this.paymentStatuts2 = 2
      }
      // if(this.payMode == 2){
      //   // 平台端打款流程审批--线下
      //   this.$http({
      //     url: "/api/quick/numb/authNumb",
      //     method: "post",
      //     headers: {
      //       "Content-Type": "application/json",
      //     },
      //     data: {
      //       id: this.authNumbId,
      //       checkReason: this.grtdsp,
      //       settlementNo: this.settlementNos,
      //       authPayCode: this.authPayCodes, // 审核状态
      //       payMode: this.payMode,
      //       paymentStatuts: this.paymentStatuts2,
      //     }
      //   }).then((data) => {
      //     if (data.code === 0) {
      //       this.$message({
      //         message: '操作成功',
      //         type: 'success',
      //         offset: 60
      //       })
      //       this.getTableData();
      //       this.taskDelShow = false
      //     }
      //   });
      // }else {
        // 平台端打款流程审批
        if (this.payMode == 1) {
          if (this.taskForm.bankExtendId == '') {
            this.$message({
              message: '请选择税源地',
              type: 'error',
              offset: 60
            })
          }else{
            this.$http({
              url: "/api/quick/record/bankRecordPass",
              method: "post",
              headers: {
                "Content-Type": "application/json",
              },
              data: {
                // authBankNo: this.authBankNos,
                authId: this.authId,
                grtdsp: this.grtdsp,
                grtflg: this.grtflg,
                settlementNo: this.settlementNos,
                id: this.authNumbId,
                payMode: this.payMode,
                paymentStatuts: this.paymentStatuts2,
              }
            }).then((data) => {
              if (data.code === 0) {
                this.$message({
                  message: '操作成功',
                  type: 'success',
                  offset: 60
                })
                this.getTableData();
                this.taskDelShow = false
              }
            });
          }
        }else {
          this.$http({
            url: "/api/quick/record/bankRecordPass",
            method: "post",
            headers: {
              "Content-Type": "application/json",
            },
            data: {
              authId: this.authId,
              // authBankNo: this.authBankNos,
              grtdsp: this.grtdsp,
              grtflg: this.grtflg,
              settlementNo: this.settlementNos,
              id: this.authNumbId,
              payMode: this.payMode,
              paymentStatuts: this.paymentStatuts2,
            }
          }).then((data) => {
            if (data.code === 0) {
              this.$message({
                message: '操作成功',
                type: 'success',
                offset: 60
              })
              this.getTableData();
              this.taskDelShow = false
            }
          });
        }
        
      // }
    },
  },
};
</script>
<style>
.examines {
  margin-top: 30px;
}
.examines b {
  font-size: 13px;
  font-weight: normal;
  color: #333;
  float: left;
  margin: -5px 13px 0 60px;
}
.examines .el-textarea {
  width: 70%;
}
.examines .el-textarea__inner {
  height: 100px;
}
.add-task .upload-demo {
    display: flex
;
}
.add-task .el-upload--text {
    width: auto;
    height: auto;
    border: 0;
    display: block;
    text-align: left;
}
.add-task .el-button--small {
    color: #326cf0;
    border-color: #326cf0;
}
</style>
<style scoped lang="scss">
.paymentThen {
  .pay-title {
    color: rgba(10, 46, 106, 1);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: bold;
  }

  .pay-desc {
    color: #6c8198;
    margin-bottom: 20px;
    font-size: 12px;
  }

  .el-pagination {
    text-align: right;
  }

  .margin-top {
    margin-top: 20px;
  }
}
.cardTits {
  p {
    position: relative;
    top: -15px;
    font-size: 15px;
    color: #da2a2a;
  }
}
.serveTime {
	float: left;
    margin-left: 50px;
    position: relative;
    top: 10px;
}
</style>
